#include "getprofilerequest.h"
#include "response/getprofileresponse.h"

#include <QDebug>
#include <QVariant>


GetProfileRequest::GetProfileRequest(qint64 userId, const QString &sessionKey):
    m_response(new GetProfileResponse()),
    m_userId(userId),
    m_sessionKey(sessionKey)
{
}


GetProfileRequest::~GetProfileRequest()
{
    delete m_response;
    m_response = 0;
}


Network::JSONResponse &GetProfileRequest::jsonResponse()
{
    return *m_response;
}


const Network::JSONResponse &GetProfileRequest::jsonResponse() const
{
    return *m_response;
}


QUrl GetProfileRequest::url() const
{
    QString url = QString("http://mapi2.me.zing.vn/frs/mapi2/user?method=user.getinfo&uids=%1&session_key=%2&fields=userid,username,tinyurl,firstname,lastname,displayname,status,gender,email,profile_url,mobile,city,dob")
            .arg(m_userId).arg(m_sessionKey);
    return QUrl(url);
}

